package com.kingdee.eas.qx.facade;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import com.kingdee.eas.scm.im.inv.InvUpdateException;
import java.lang.String;
import java.util.Set;
import com.kingdee.eas.common.EASBizException;
import com.alibaba.fastjson.JSONObject;



public abstract class AbstractQXFacadeControllerBean extends AbstractBizControllerBean implements QXFacadeController
{
    protected AbstractQXFacadeControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("90B766B3");
    }

    public void sendMaterialPort(Context ctx) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("0a6de6a0-2b0c-4b33-a47a-f7e0565f7be5"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _sendMaterialPort(ctx);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _sendMaterialPort(Context ctx) throws BOSException, EASBizException;

    public JSONObject baseDataTransformInput(Context ctx, String billDataNumber, String jsonData, JSONObject result) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a2ad65aa-8899-4e0b-8b2b-24dea92e79fb"), new Object[]{ctx, billDataNumber, jsonData, result});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            JSONObject retValue = (JSONObject)_baseDataTransformInput(ctx, billDataNumber, jsonData, result);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (JSONObject)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract JSONObject _baseDataTransformInput(Context ctx, String billDataNumber, String jsonData, JSONObject result) throws BOSException, EASBizException;

    public void sendClientPort(Context ctx) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("e02f53f5-30ca-4b99-a8fa-63747db4f987"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _sendClientPort(ctx);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _sendClientPort(Context ctx) throws BOSException, EASBizException;

    public void sendSupplierPort(Context ctx) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("2491d6d8-cfc6-4641-8ace-ff24b06fc67a"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _sendSupplierPort(ctx);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _sendSupplierPort(Context ctx) throws BOSException, EASBizException;

    public JSONObject billDataTransformInput(Context ctx, String billDataNumber, String josnData, String srcBillId, JSONObject result) throws BOSException, InvUpdateException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("b0f2f7fe-05fc-437c-adb2-a86dde97c40e"), new Object[]{ctx, billDataNumber, josnData, srcBillId, result});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            JSONObject retValue = (JSONObject)_billDataTransformInput(ctx, billDataNumber, josnData, srcBillId, result);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (JSONObject)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (InvUpdateException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } catch (EASBizException ex1) {
            this.setRollbackOnly();
            throw ex1;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract JSONObject _billDataTransformInput(Context ctx, String billDataNumber, String josnData, String srcBillId, JSONObject result) throws BOSException, InvUpdateException, EASBizException;

    public boolean sendMaterial(Context ctx, Set billID) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("53b9b224-4e64-4abf-9e04-aab4f2707b7b"), new Object[]{ctx, billID});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            boolean retValue = (boolean)_sendMaterial(ctx, billID);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            }
            invokeServiceAfter(svcCtx);
            return ((Boolean)svcCtx.getMethodReturnValue()).booleanValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _sendMaterial(Context ctx, Set billID) throws BOSException, EASBizException;

    public boolean sendBillPort(Context ctx, String billID, String BusicessNumber) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("bf069cf2-860e-4b46-bf10-b2da35c42400"), new Object[]{ctx, billID, BusicessNumber});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            boolean retValue = (boolean)_sendBillPort(ctx, billID, BusicessNumber);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            }
            invokeServiceAfter(svcCtx);
            return ((Boolean)svcCtx.getMethodReturnValue()).booleanValue();
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _sendBillPort(Context ctx, String billID, String BusicessNumber) throws BOSException, EASBizException;

    public void sendBaseData(Context ctx, Set idSet, String number) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a0ef671d-1cf2-480c-af38-15a9e02082c8"), new Object[]{ctx, idSet, number});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _sendBaseData(ctx, idSet, number);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _sendBaseData(Context ctx, Set idSet, String number) throws BOSException, EASBizException;

}